import request from '@/utils/request';

/** 查询应收款列表 */
export const getAccountsReceivableListApi = (data: any) => {
    return request({
        url: '/system/accountsReceivable/list',
        method: 'post',
        data: data
    });
};

/**新增收款记录 */
export const addAccountsReceivableApi = (data: any) => {
    return request({
        url: '/system/accountsReceivable/collectPayment',
        method: 'post',
        data: data
    });
};

/** 新增坏账记录 */
export const addBadDebtApi = (data: any) => {
    return request({
        url: '/system/accountsReceivable/saveBadDebt',
        method: 'post',
        params: data
    });
};

/** 获取应收款详细信息 获取收款记录 */
export const getAccountsReceivableApi = (id: any) => {
    return request({
        url: '/system/accountsReceivable/getReceiveDetailList',
        method: 'get',
        params: { id }
    });
};

/** 获取坏账历史记录 */
export const getBadDebtHistoryApi = () => {
    return request({
        url: '/system/accountsReceivable/getBadDebtList',
        method: 'get',
    });
};

/**删除应收款 */
export const deleteAccountsReceivableApi = (ids: any) => {
    return request({
        url: `/system/accountsReceivable/${ids}`,
        method: 'delete',
    });
};